home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 / Nebula One.iso / Utilities / Unix / skey / src / md4.h < prev    next >
C/C++ Source or Header  |  1993-10-25  |  2KB  |  51 lines

  1. /* 
  2.  *
  3.  * md4.h -- Header file for implementation of MD4 Message Digest Algorithm
  4.  * Updated: 2/13/90 by Ronald L. Rivest
  5.  * (C) 1990 RSA Data Security, Inc.
  6.  * Reformatted and de-linted - 2/12/91 Phil Karn
  7.  */
  8.  
  9. #ifdef  __STDC__
  10. #define __ARGS(X) X     /* For ANSI C */
  11. #else
  12. #define __ARGS(X) ()
  13. #endif
  14.  
  15. /* MDstruct is the data structure for a message digest computation. */
  16. typedef struct {
  17.     unsigned long buffer[4];/* Holds 4-word result of MD computation */
  18.     unsigned char count[8];    /* Number of bits processed so far */
  19.     unsigned int done;    /* Nonzero means MD computation finished */
  20. } MDstruct, *MDptr;
  21.  
  22. /* MDbegin(MD)
  23.  * Input: MD -- an MDptr
  24.  * Initialize the MDstruct prepatory to doing a message digest computation.
  25.  */
  26. extern void MDbegin __ARGS((MDptr MDp));
  27.  
  28. /* MDupdate(MD,X,count)
  29.  * Input: MD -- an MDptr
  30.  *        X -- a pointer to an array of unsigned characters.
  31.  *        count -- the number of bits of X to use (an unsigned int).
  32.  * Updates MD using the first ``count'' bits of X.
  33.  * The array pointed to by X is not modified.
  34.  * If count is not a multiple of 8, MDupdate uses high bits of last byte.
  35.  * This is the basic input routine for a user.
  36.  * The routine terminates the MD computation when count < 512, so
  37.  * every MD computation should end with one call to MDupdate with a
  38.  * count less than 512.  Zero is OK for a count.
  39.  */
  40. extern void MDupdate __ARGS((MDptr MDp,unsigned char *X,unsigned int count));
  41.  
  42. /* MDprint(MD)
  43.  * Input: MD -- an MDptr
  44.  * Prints message digest buffer MD as 32 hexadecimal digits.
  45.  * Order is from low-order byte of buffer[0] to high-order byte of buffer[3].
  46.  * Each byte is printed with high-order hexadecimal digit first.
  47.  */
  48. extern void MDprint __ARGS((MDptr MDp));
  49.  
  50. /* End of md4.h */
  51.